function Books()
{
   var books = [];
   
   this.addBook =
     function (book)
     {
       books.push(book);
     }

   this.getBooks =
     function ()
     {
       return books;
     }
   
   this.getAvailable =
     function ()
     {
       return this.getBooks().filter(function (book) { return !book.outOfPrint });
     }
}


///

var books = new Books();
books.addBook({isbn:123});
books.addBook({isbn:234, outOfPrint:true});
books.addBook({isbn:456});
books.addBook({isbn:678});
books.addBook({isbn:890});
books.addBook({isbn:901});

print(books.getAvailable().map(function (book) { return book.isbn }));